<!-- 加载layout.html -->
{{extend('./layout.html')}}

{{#block('main')}}
<div class="main-container">
	<div class="padding-md">

		<ul class="breadcrumb">

			<li><span class="primary-font"><i class="icon-home"></i></span><a href="index.html"> 主页</a></li>
			<li>班级管理</li>
			<li>班级列表</li>
			<li class="pull-right"><a href="/admin/class/class_add" class="btn btn-primary">添加班级</a></li>
		
		</ul>
		<form action="/admin/class/class_deleteAll" method="POST">
		<table class="table table-striped" id="dataTable">
			<thead>
				<tr>
					<th class="text-center">
						<button style="display: block;
						margin: 0 auto;
						margin-bottom: 10px;
						background: #e36159;
						border: 1px solid #df4c43;
						padding: 3px 7px;
						border-radius: 5px;
						color: white;" id="dels" >批量删除</button>

						<div class="custom-checkbox">

							<input type="checkbox" id="chkAll" class="inbox-check">
							<label for="chkAll"></label>
						</div>
					</th>
					<th>序号</th>
					<th>班级名字</th>
					<th>开班时间</th>

					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{{#each(claList)}}
				<tr>
					<td class="text-center">
						<div class="custom-checkbox">
							<input type="checkbox" name="ids[]" value="{{this.class_id}}" id="chk{{xindex+1}}"
								class="inbox-check">
							<label for="chk{{xindex+1}}"></label>
						</div>
					</td>
					<td>{{xindex+1}}</td>
					<td>{{this.class_name}}</td>
					<td class="stu_time" data-time="{{this.class_time}}"></td>

					<td>
						<a href="/admin/class/class_edit/{{this.class_id}}" class="btn btn-success">修改</a>
						<a href="javascript:;" class="btn btn-danger widget-remove-option" id="{{this.class_id}}"
							ctrname="class">删除</a>
					</td>
				</tr>
				{{/each}}
			</tbody>
		</table>
		</form>
		<!-- 包含分页文件 -->
		{{include('./page.html')}}

	</div><!-- ./padding-md -->
</div><!-- /main-container -->
{{/block}}
<script>
	$('#chkAll').click(function () {
				if ($(this).prop('checked')) {
					$('.inbox-check').prop('checked', true);
					$('.inbox-check').parent().parent().parent().addClass('active');
				}
				else {
					$('.inbox-check').prop('checked', false);
					$('.inbox-check').parent().parent().parent().removeClass('active');
				}
			});

</script>